Skip to content

Conversation

@cccclai
Copy link
Contributor

@cccclai cccclai commented Aug 12, 2025

Summary:
As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 12, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13342

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 2 Pending, 1 Unrelated Failure

As of commit 002e655 with merge base f7df6b1 (image):

NEW FAILURE - The following job has failed:

  • pull / test-openvino-linux / linux-job (gh)
    /pytorch/executorch/backends/qualcomm/runtime/QnnBackendOptions.cpp:28:20: error: no match for ‘operator=’ (operand types are ‘executorch::runtime::BackendOption’ and ‘<brace-enclosed initializer list>’)

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 12, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607

@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Aug 12, 2025
Summary:

As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Aug 13, 2025
Summary:

As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Aug 14, 2025
Summary:

As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Aug 18, 2025
Summary:

As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607

@cccclai
Copy link
Contributor Author

cccclai commented Aug 21, 2025

Can I get a review on this PR? @haowhsu-quic @shewu-quic @winskuo-quic @DannyYuyang-quic

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Aug 21, 2025
Summary:

As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607

Copy link
Contributor

@DannyYuyang-quic DannyYuyang-quic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for supporting more ops!!

Comment on lines 203 to 200
@dataclass(init=False, frozen=True)
class OpElementWiseAnd:
op_name: str = "ElementWiseAnd"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cccclai, since we already have OpElementWiseAnd at line 111, I believe there's no need to add it again. Thanks!!

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Aug 22, 2025
Summary:

As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607


@register_node_visitor
class And(NodeVisitor):
target = ["aten.logical_and.default"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could extend the target field in builders/op_and.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to do that, however I found out the logical_and op doesn't have the corresponding q/dq ops when trying module = self.get_qdq_module(module, sample_input), do you know which path I should be updating?

Copy link
Collaborator

@shewu-quic shewu-quic Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to extend annotation with new target in quantizer/annotator.py

@register_annotator([torch.ops.aten.__and__.Tensor])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the latest version correct? It seems still missing the q/dq ops

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because the input is bool type so it won't have qdq. Could you try either 1) FP input. 2) When calling get_qdq_module in UT, also set bypass_check=True?

Copy link
Collaborator

@shewu-quic shewu-quic Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I believe the reason is because the input is bool (uint8) rather than float.

if _is_float_tensor(input_act0):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks! Yeah it's indeed the reason

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Sep 3, 2025
Summary:

As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Sep 11, 2025
Summary:

As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80122607

Summary:

As title, add the logical and op for an internal model

Differential Revision: D80122607
cccclai added a commit to cccclai/executorch-1 that referenced this pull request Sep 12, 2025
Summary:

As title, add the logical and op for an internal model

Differential Revision: D80122607
@facebook-github-bot
Copy link
Contributor

@cccclai has exported this pull request. If you are a Meta employee, you can view the originating diff in D80122607.

@cccclai
Copy link
Contributor Author

cccclai commented Sep 12, 2025

I have it fix, does the new version look good now? @shewu-quic @haowhsu-quic @winskuo-quic @DannyYuyang-quic

@facebook-github-bot
Copy link
Contributor

@cccclai has exported this pull request. If you are a Meta employee, you can view the originating diff in D80122607.

@shewu-quic
Copy link
Collaborator

LGTM. Thanks!

@cccclai cccclai merged commit e6b9111 into pytorch:main Sep 12, 2025
122 of 125 checks passed
StrycekSimon pushed a commit to nxp-upstream/executorch that referenced this pull request Sep 23, 2025
Summary:
As title, add the logical and op for an internal model

Rollback Plan:

Differential Revision: D80122607
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants